package cn.zbh._03_oneway_a;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

public class Producer {
    public static void main(String[] args) throws  Exception {
        DefaultMQProducer producer = new DefaultMQProducer("oneway_a");
        producer.setNamesrvAddr("localhost:9876");
        producer.start();

        Message hehe = new Message("oneway-aaaa", "hehe", "加油啊".getBytes(StandardCharsets.UTF_8));
         producer.sendOneway(hehe);



        producer.shutdown();
    }
}
